package com.damon.day03;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;

/**
 * @Date 2020/4/17 21:27
 * @Created by Damon
 */
public class DeleteProcessDefinition {
    public static void main(String[] args) {

        /*
        * 背后影响的表
        * act_ge_bytearray
        * act_re_deployment
        * act_re_procdef
        * 注意事项
        * 当我们正在执行的这一套流程设定没有完全审批结束的时候,此时如果要删除流程定义信息就会失败
        * 如果要强制删除,可以使用repositoryService.deleteDeployment("1", true);
        * */
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        RepositoryService repositoryService = processEngine.getRepositoryService();

        repositoryService.deleteDeployment("1");//processDefinition.getDeploymentId()

    }
}
